package cn.shop.cloud.mapper;

import cn.shop.cloud.domain.SeckillOrder;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @program: shop-parent
 * @ClassName SeckillOrderMapper
 * @description:
 * @author: Mokio
 * @create: 2024−12-24 20:54
 * @Version 2024 2.2 ; jdk1.8.0_181
 **/
// 秒杀订单
@Mapper
public interface SeckillOrderMapper {
    // 创建秒杀订单
    @Insert("INSERT  INTO t_seckill_order (user_id,order_no,seckill_id) VALUES (#{userId},#{orderNo},#{seckillId}) ")
    public void insert(SeckillOrder so);
    // 根据用户id和商品id查询秒杀订单
    @Select("SELECT * FROM t_seckill_order WHERE user_id=#{userId} and seckill_id=#{seckillId}")
    public SeckillOrder findUserIdAndSeckillId(Long userId, Long seckillId);
}
